package com.zj.leetcode.medium.binarySearch;

/**
 * @program: algorithm
 * @description: 寻找峰值
 * 162 find-peak-element
 * @author: Zhang Bo
 * @create: 2022-04-25 12:35:15
 **/
public class FindPeakElement {
    public static void main(String[] args) {
        Solution solution = new FindPeakElement().new Solution();
    }

    //leetcode submit region begin(Prohibit modification and deletion)
    class Solution {
        public int findPeakElement(int[] nums) {
            int idx = 0;
            for (int i = 1; i < nums.length; ++i) {
                if (nums[i] > nums[idx]) {
                    idx = i;
                }
            }
            return idx;
        }
    }
//leetcode submit region end(Prohibit modification and deletion)

}
